-- fool
-- created by zhuangsl
-- 愚者

return {
    fetchProps = function(who, status, condition)
        local props  = {};
        local propId = PropM.getPropId("attrib2");
        local value  = tonumber(condition["defense"]);
        local endRound = condition["end_round"];

        if value > 0 then
            table.insert(props, { propId, "defense", value, endRound, });
        end

        -- 降低远程伤害
        local ranged_damage = condition["ranged_damage"];
        if ranged_damage then
            propId = PropM.getPropId("ranged_damage");
            table.insert(props, { propId, 1, ranged_damage, endRound, });
        end

        return props;
    end,

    desc = function(who, status, condition)
        -- 获取状态描述
        local cfg = CombatStatusM.getStatusInfo(status);
        local desc = cfg.desc;

        -- 额外效果，百分比
        local ranged_damage = condition["ranged_damage"];
        if ranged_damage then
            desc = cfg.extra_desc;
            ranged_damage = math.modf(ranged_damage / 10);
            desc = string.gsub(desc, "{append}", ranged_damage);
        end

        -- 效果
        local value  = condition["defense"];
        desc = string.gsub(desc, "{value}", value);

        return desc;
    end,
};
